import React, { PropTypes } from 'react';
import { Form, Input, Button, Select } from 'antd';
import '../less/user.less';


const UserSearch = ({
    onSearch,
    onAdd,
  }) => {
  function handleSubmit(e) {
    e.preventDefault();
    onSearch('wyz');
  }

  return (
    <div className="headOption">
      <div className='search'>
        <Form inline onSubmit={handleSubmit}>
          <Form.Item>
              <Select value={'name'}>
                <Select.Option value="name">名字</Select.Option>
                <Select.Option value="address">地址</Select.Option>
              </Select>
          </Form.Item>
          <Form.Item
            hasFeedback
          >
              <Input type="text" />
          </Form.Item>
          <Button style={{ marginRight: '10px' }} type="primary" htmlType="submit">搜索</Button>
        </Form>
      </div>
      <div className='create'>
        <Button type="ghost" onClick={onAdd}>添加</Button>
      </div>
    </div>
  );
};

UserSearch.propTypes = {
  form: PropTypes.object.isRequired,
  onSearch: PropTypes.func,
  onAdd: PropTypes.func,
  field: PropTypes.string,
  keyword: PropTypes.string,
};

export default Form.create()(UserSearch);
